﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SiGeSIB.Business.Impl;
using SiGeSIB.Data.Security;

namespace SiGeSIB.Services.Impll
{
	public class SecurityServices : ISecurityServicesProvider
	{
		public SecurityServices()
		{
			_Controler = new SecurityController();
		}
		
		private SecurityController _Controler;

		#region ISecurityServicesProvider Members
		#region Login
		public User Login(string login, string password)
		{
			return _Controler.Login(login, password);
		} 
		#endregion

		#region Gets
		public User GetUser(int idUser)
		{
			return
				_Controler.GetUser(idUser);
		}
		public List<User> GetUsers()
		{
			return
				GetUsers(null);
		}
		public List<User> GetUsers(int[] ids)
		{
			return _Controler.GetUsers(ids);
		}
		#endregion

		public int InsertUser(User user)
		{
			return _Controler.InsertUser(user);
		}
		public void UpdateUser(User user)
		{
			_Controler.UpdateUser(user);
		}
		public void RemoveUser(int id)
		{
			_Controler.RemoveUser(id);
		}

		public EPermissions GetUserPermissions(int idUser)
		{
			return
				_Controler.GetUserPermission(idUser);
		}
		public void SaveUserPermissions(int userId, EPermissions permission)
		{
			_Controler.SaveUserPermission(userId, permission);
		}
		#endregion
	}
}
